#include<iostream>
using namespace std;
#include<vector>
int flag = 0,n;
int start[11],stay[11],down[11];
bool check[11];
bool dfs(int now,int time) {
	if (now == n) {
		flag = 1;
		return true;
	}
	int last = time;
	for (int i = 0; i < n; ++i) {
		if (check[i] == false&&start[i]+stay[i]>=time) {
			if (time >= start[i])
				time += down[i];
			else
				time = start[i] + down[i];
			check[i] = true;
			dfs(now+1, time);
			check[i] = false;
			time = last;
		}
	}
	return false;
}
void test() {
	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> start[i] >> stay[i] >> down[i];
	for (int i = 0; i < n; ++i) {
		check[i] = true;
		dfs(1, start[i] + down[i]);
		check[i] = false;
	}
	if (flag)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	flag = 0;
}
int main() {
	int T;
	cin >> T;
	while (T--)
		test();
	return 0;
}